<?php
/**
 * Created by PhpStorm.
 * User: dev
 * Date: 7/10/14
 * Time: 1:07 PM
 */

class Site_Widget_Footer_Controller extends Base_Controller {

    public $restful = true;

    public function __construct()
    {
        parent::__construct();
        //--Your Code --//
        $this->theme->set_theme("default") ;
        $this->theme->set_layout('column1');
    }


    public function get_index($location=0){

    	$data['pages'] = DB::table('pages')->get();
    	
    	return View::make('Site::widget.footer',$data);
    }
    
    public function get_pages($slug=''){
    	
    	$data['page']['info'] = DB::table('pages')->where('slug','=',$slug)->first();
    	
    	/*-- META DATA */
    	$this->theme->title($data['page']['info']->meta_title.' - '.Settings::get('en','site_title'));
    	$this->theme->description($data['page']['info']->meta_description);
    	$this->theme->keyword($data['page']['info']->meta_keyword);
    	
    	/*-- BREADCRUMB */
    	
    	Breadcrumb::addbreadcrumb('Home', URL::base());
    	Breadcrumb::addbreadcrumb($data['page']['info']->title, URL::base());
    	Breadcrumb::setSeparator('&raquo;');
    	$data['breadcrumb'] = Breadcrumb::generate();
    	
    	return $this->theme->render('site::widget.footer_info',$data);
    }
    
}